import { createRouter, createWebHistory } from 'vue-router'
import Layout from '@/views/Layout'
import Selected from '@/test/select.vue'
const routes = [
  {
    path: '/login',
    component: () => import('@/views/Login')
  },
  {
    path: '/',
    name: 'Layout',
    component: Layout,
    children: [
      {
        path: '',
        component: () => import('@/views/Home')
      },
      { path: '/category/:id', component: () => import('@/views/Category') },
      { path: '/category/sub/:id', component: () => import('@/views/Category/sub') },
      { path: '/goods/:id', component: () => import('@/views/Goods') },
      { path: '/cart', component: () => import('@/views/Cart') },
      { path: '/settlement', component: () => import('@/views/settlement') },
      { path: '/pay/:id', name: 'pay', component: () => import('@/views/pay') }
    ]
  },
  {
    path: '/selected',
    component: Selected
  }
]

const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router
